package com.netease.b.b.d;

import com.netease.b.b.e.f;
import com.netease.b.b.e.g;
import com.netease.b.b.e.k;
import com.netease.framework.a.m;
import com.netease.pris.a.i;
import com.netease.pris.c.l;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
import org.json.JSONException;
import org.json.JSONObject;

public class a extends k
{
  private static final String a = "/api/t/add_pic";
  private static final String b = "/api/t/add";
  private String j;
  private String k;
  private String l;
  private String m;
  private String n;
  private m o;

  protected a(int paramInt)
  {
    super(paramInt);
  }

  private m a(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    Hashtable localHashtable = new Hashtable();
    String str = c.a().a("/api/t/add");
    localHashtable.put("format", "json");
    localHashtable.put("content", paramString1);
    if (!com.netease.c.b.a(paramString2))
      localHashtable.put("wei", paramString2);
    if (!com.netease.c.b.a(paramString3))
      localHashtable.put("jing", paramString3);
    Object localObject;
    if (!i.e(paramString4))
    {
      e locale = new e(this, c.a().a("/api/t/add_pic"), com.netease.framework.a.b.b, c.a().b());
      if (localHashtable != null)
      {
        Iterator localIterator = localHashtable.entrySet().iterator();
        while (localIterator.hasNext())
        {
          Map.Entry localEntry = (Map.Entry)localIterator.next();
          locale.a((String)localEntry.getKey(), (String)localEntry.getValue());
        }
      }
      localObject = locale;
    }
    while (true)
    {
      return localObject;
      localObject = c.a().b().a(com.netease.framework.a.b.b, str, localHashtable);
      ((com.netease.c.b.c)localObject).a(true);
    }
  }

  public static com.netease.framework.b.a a(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    int i = 4097;
    if (!i.e(paramString3))
      i = 4098;
    a locala = new a(i);
    locala.k = paramString3;
    locala.j = paramString2;
    locala.l = paramString4;
    locala.m = paramString5;
    locala.n = paramString1;
    return locala;
  }

  private void a(String paramString1, String paramString2)
  {
    c.a().a(paramString1, paramString2);
  }

  private boolean a()
  {
    int i = 1;
    String[] arrayOfString = l.c(com.netease.b.a.d.h().a(), this.n, 2);
    if ((arrayOfString != null) && (arrayOfString.length == 2) && (!i.e(arrayOfString[0])) && (!i.e(arrayOfString[i])))
      a(arrayOfString[0], arrayOfString[i]);
    while (true)
    {
      return i;
      i = 0;
    }
  }

  private Object b(String paramString)
  {
    Object localObject = null;
    g localg = new g(2);
    try
    {
      JSONObject localJSONObject = new JSONObject(paramString);
      int i = localJSONObject.getInt("ret");
      if (i != 0)
      {
        localObject = c.a().a(i, paramString);
      }
      else
      {
        localg.a(com.netease.c.b.c(localJSONObject.optJSONObject("data").optString("id")));
        if ((localg == null) || (!i.e(localg.b())))
          localObject = localg;
      }
    }
    catch (JSONException localJSONException)
    {
      while (true)
      {
        localJSONException.printStackTrace();
        localg = null;
      }
    }
    return localObject;
  }

  public void a(int paramInt, String paramString)
  {
    f localf = c.a().a(paramInt, paramString);
    d(localf.h, localf);
  }

  public void a(String paramString)
  {
    Object localObject;
    switch (n())
    {
    default:
      localObject = null;
      if (o())
        break;
      if (localObject != null)
        if ((localObject instanceof f))
          d(((f)localObject).h, localObject);
    case 4097:
    case 4098:
    }
    while (true)
    {
      return;
      localObject = b(paramString);
      break;
      c(0, localObject);
      continue;
      d(-1, null);
    }
  }

  public void c()
  {
    if (!a())
    {
      d(-2, null);
      com.netease.g.b.d("***********", "Error  withou token & secret to send blog");
    }
    while (true)
    {
      return;
      switch (n())
      {
      default:
      case 4097:
      case 4098:
      }
      while (true)
      {
        if ((this.o == null) || (o()))
          break label100;
        a(this.o);
        break;
        this.o = a(this.j, this.l, this.m, this.k);
      }
      label100: d(-4, null);
      h();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.b.b.d.a
 * JD-Core Version:    0.6.0
 */